package z.practice_io;

import java.io.*;

/**
 * @author yi qiang
 * @date 2021/6/1 15:38
 */
public class InputStreamReadDemo {


    public static void main(String[] args) throws IOException {
        try (InputStream inputStream = new FileInputStream("src/z/practice_io/test.txt");
             OutputStream outputStream = new FileOutputStream("src/z/practice_io/test2.txt");
             OutputStreamWriter writer = new OutputStreamWriter(outputStream);
             InputStreamReader reader = new InputStreamReader(inputStream);
             BufferedReader bufferedReader=new BufferedReader(reader)) {
           String str;
           while ((str=bufferedReader.readLine())!=null){
               writer.write(str+"\r");
           }
            System.out.println("finish");
        }
    }

}
